import { resolve } from 'node:path';
import { defineConfig } from './src/plugins/vite';

export default defineConfig(async () => {
  return {
    application: {},
    vite: {
      plugins: [],
      server: {
        proxy: {
          '/dev-api': {
            changeOrigin: true,
            rewrite: (path) => path.replace(/^\/dev-api/, ''),
            // 代理目标地址
            // target: 'http://113.44.155.182:13000',
            target: 'http://localhost:13000',
            ws: false,
          },
        },
      },
      resolve: {
        alias: {
          '@': resolve(__dirname, './src'),
          '@core': resolve(__dirname, './src/core/base'),
        },
        extensions: ['.js', '.ts', '.json', '.vue', '.jsx', '.tsx'],
      },
    },
  };
});
